package com.onetwork.core.ui.components.dialog.actions;

import com.onetwork.core.ui.components.dialog.ListagemDialog;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import javax.swing.KeyStroke;

public class RegistroAnteriorAction extends AbstractAction {
    private ListagemDialog listagemDialog;
    public RegistroAnteriorAction(ListagemDialog listagemDialog) {
        super("Registro anterior",new ImageIcon(RegistroAnteriorAction.class.getResource("/imagens/navigate_left.png")));
        this.putValue(SHORT_DESCRIPTION, "Posiciona no registro anterior");
        this.putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, ActionEvent.ALT_MASK));
        this.putValue(MNEMONIC_KEY, new Integer(KeyEvent.VK_PAGE_DOWN));
        this.listagemDialog = listagemDialog;
    }

    public void actionPerformed(ActionEvent event) {
        this.listagemDialog.registroAnterior();
    }    
}
